<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>7. source map 和代码压缩 | 被删的前端游乐场</title>
    <meta name="generator" content="VuePress 1.8.2">
    
    <meta name="description" content="Just playing around">
    
    <link rel="preload" href="/front-end-playground/assets/css/0.styles.6ad2a9ca.css" as="style"><link rel="preload" href="/front-end-playground/assets/js/app.1e2670bf.js" as="script"><link rel="preload" href="/front-end-playground/assets/js/2.38d016d1.js" as="script"><link rel="preload" href="/front-end-playground/assets/js/3.e3f029cb.js" as="script"><link rel="preload" href="/front-end-playground/assets/js/149.1a9bd99e.js" as="script">
    <link rel="stylesheet" href="/front-end-playground/assets/css/0.styles.6ad2a9ca.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/front-end-playground/" class="home-link router-link-active"><!----> <span class="site-name">被删的前端游乐场</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/front-end-playground/" class="nav-link">概述</a></div><div class="nav-item"><a href="/front-end-playground/front-end-basic/" class="nav-link">前端领域</a></div><div class="nav-item"><a href="/front-end-playground/vue/" class="nav-link router-link-active">Vue学习</a></div><div class="nav-item"><a href="/front-end-playground/wxapp/" class="nav-link">小程序学习</a></div><div class="nav-item"><a href="/front-end-playground/front-end-others/" class="nav-link">百家齐放</a></div><div class="nav-item"><a href="/front-end-playground/front-end-addon/" class="nav-link">前端的进击</a></div><div class="nav-item"><a href="/front-end-playground/front-end-work/" class="nav-link">前端与工作</a></div><div class="nav-item"><a href="/front-end-playground/faq.html" class="nav-link">FAQ</a></div> <a href="https://github.com/godbasin/front-end-playground" target="_blank" rel="noopener noreferrer" class="repo-link">
    Github
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/front-end-playground/" class="nav-link">概述</a></div><div class="nav-item"><a href="/front-end-playground/front-end-basic/" class="nav-link">前端领域</a></div><div class="nav-item"><a href="/front-end-playground/vue/" class="nav-link router-link-active">Vue学习</a></div><div class="nav-item"><a href="/front-end-playground/wxapp/" class="nav-link">小程序学习</a></div><div class="nav-item"><a href="/front-end-playground/front-end-others/" class="nav-link">百家齐放</a></div><div class="nav-item"><a href="/front-end-playground/front-end-addon/" class="nav-link">前端的进击</a></div><div class="nav-item"><a href="/front-end-playground/front-end-work/" class="nav-link">前端与工作</a></div><div class="nav-item"><a href="/front-end-playground/faq.html" class="nav-link">FAQ</a></div> <a href="https://github.com/godbasin/front-end-playground" target="_blank" rel="noopener noreferrer" class="repo-link">
    Github
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0" style="padding-top:;"><!----> <p class="sidebar-heading"><span>9102 全员学 Vue</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0" style="padding-top:;"><!----> <p class="sidebar-heading"><span>深入理解 Vue 动画效果</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0" style="padding-top:10px;"><div class="kitty-main" data-v-2b653b36><span class="stand" data-v-2b653b36></span> <div class="cat" data-v-2b653b36><div class="body" data-v-2b653b36></div> <div class="head" data-v-2b653b36><div class="ear" data-v-2b653b36></div> <div class="ear" data-v-2b653b36></div></div> <div class="face" data-v-2b653b36><div class="nose" data-v-2b653b36></div> <div class="whisker-container" data-v-2b653b36><div class="whisker" data-v-2b653b36></div> <div class="whisker" data-v-2b653b36></div></div> <div class="whisker-container" data-v-2b653b36><div class="whisker" data-v-2b653b36></div> <div class="whisker" data-v-2b653b36></div></div></div> <div class="tail-container" data-v-2b653b36><div class="tail" data-v-2b653b36><div class="tail" data-v-2b653b36><div class="tail" data-v-2b653b36><div class="tail" data-v-2b653b36><div class="tail" data-v-2b653b36><div class="tail" data-v-2b653b36><div class="tail" data-v-2b653b36></div></div></div></div></div></div></div></div></div></div> <p class="sidebar-heading open"><span>Webpack 实现 Vue 多页应用</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/front-end-playground/vue/vue-multi-page/1-init-project.html" class="sidebar-link">1. 基础 webpack 配置</a></li><li><a href="/front-end-playground/vue/vue-multi-page/2-page-utils.html" class="sidebar-link">2. 拿取页面目录名</a></li><li><a href="/front-end-playground/vue/vue-multi-page/3-node-packages.html" class="sidebar-link">3. 打包相关 node 模块介绍</a></li><li><a href="/front-end-playground/vue/vue-multi-page/4-build.html" class="sidebar-link">4. 页面打包实现</a></li><li><a href="/front-end-playground/vue/vue-multi-page/5-dev-server.html" class="sidebar-link">5. 开发服务启动</a></li><li><a href="/front-end-playground/vue/vue-multi-page/6-hot-reload.html" class="sidebar-link">6. 热加载刷新</a></li><li><a href="/front-end-playground/vue/vue-multi-page/7-source-map-and-uglifyjs.html" aria-current="page" class="active sidebar-link">7. source map 和代码压缩</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/front-end-playground/vue/vue-multi-page/7-source-map-and-uglifyjs.html#关于-source-map" class="sidebar-link">关于 source map</a></li><li class="sidebar-sub-header"><a href="/front-end-playground/vue/vue-multi-page/7-source-map-and-uglifyjs.html#devtool-选项" class="sidebar-link">devtool 选项</a></li><li class="sidebar-sub-header"><a href="/front-end-playground/vue/vue-multi-page/7-source-map-and-uglifyjs.html#开发环境添加-source-map" class="sidebar-link">开发环境添加 source map</a></li><li class="sidebar-sub-header"><a href="/front-end-playground/vue/vue-multi-page/7-source-map-and-uglifyjs.html#生产环境-source-map" class="sidebar-link">生产环境 source map</a></li><li class="sidebar-sub-header"><a href="/front-end-playground/vue/vue-multi-page/7-source-map-and-uglifyjs.html#代码压缩" class="sidebar-link">代码压缩</a></li></ul></li><li><a href="/front-end-playground/vue/vue-multi-page/8-certain-loaders.html" class="sidebar-link">8. 静态资源 loader 们</a></li></ul></section></li><li><a href="http://www.godbasin.com/vue-ebook/" target="_blank" rel="noopener noreferrer" class="sidebar-link">深入理解Vue.js与实战<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><p>项目中需要搭建一个多页面的环境，包括本地路由服务和分页面打包。本节介绍开发部署和生产环境打包时，启用 source map 相关配置。</p> <h1 id="devtool"><a href="#devtool" class="header-anchor">#</a> devtool</h1> <p>此选项控制是否生成，以及如何生成<code>source map</code>。</p> <h2 id="关于-source-map"><a href="#关于-source-map" class="header-anchor">#</a> 关于 source map</h2> <p>当 webpack 打包源代码时，可能会很难追踪到错误和警告在源代码中的原始位置。
例如，如果将多个源文件打包到一个文件中，而其中一个源文件包含一个错误，那么堆栈跟踪就会简单地指向到该文件。这并通常没有太多帮助，因为你可能需要准确地知道错误来自于哪个源文件。</p> <p>为了更容易地追踪错误和警告，JavaScript 提供了<code>source map</code>功能，将编译后的代码映射回原始源代码。</p> <h2 id="devtool-选项"><a href="#devtool-选项" class="header-anchor">#</a> devtool 选项</h2> <p>对于开发环境，通常希望更快速的<code>Source Map</code>，需要添加到<code>bundle</code>中以增加体积为代价。
但是对于生产环境，则希望更精准的<code>Source Map</code>，需要从<code>bundle</code>中分离并独立存在。</p> <ul><li><p>开发环境</p> <ul><li><code>eval</code> <ul><li>每个模块都使用<code>eval()</code>执行，并且都有<code>//@ sourceURL</code>。</li> <li>此选项会相当快地构建。主要缺点是，由于会映射到转换后的代码，而不是映射到原始代码，所以不能正确的显示显示行数。</li></ul></li> <li><code>inline-source-map</code> <ul><li><code>SourceMap</code>转换为<code>DataUrl</code>后添加到<code>bundle</code>中。</li></ul></li> <li><code>eval-source-map</code> <ul><li>每个模块使用<code>eval()</code>执行，并且<code>SourceMap</code>转换为<code>DataUrl</code>后添加到<code>eval()</code>中。</li> <li>初始化<code>SourceMap</code>时比较慢，但是会在重构建时提供很快的速度，并且生成实际的文件。行数能够正确映射，因为会映射到原始代码中。</li></ul></li> <li><code>cheap-eval-source-map</code> <ul><li>和<code>eval-source-map</code>类似，每个模块都使用<code>eval()</code>执行。</li> <li>使用此选项，<code>Source Map</code>将传递给<code>eval()</code>作为<code>Data URL</code>调用。它是“低性能开销”的，因为它没有映射到列，只映射到行数。</li></ul></li> <li><code>cheap-module-eval-source-map</code>（推荐使用）
<ul><li>和<code>cheap-eval-source-map</code>类似，然而，在这种情况下，<code>loader</code>能够处理映射以获得更好的结果。</li></ul></li></ul></li> <li><p>生产环境</p> <ul><li><code>source-map</code> <ul><li>生成完整的<code>SourceMap</code>，输出为独立文件。</li> <li>由于在<code>bundle</code>中添加了引用注释，所以开发工具知道在哪里去找到<code>SourceMap</code>。</li></ul></li> <li><code>hidden-source-map</code> <ul><li>和<code>source-map</code>相同，但是没有在<code>bundle</code>中添加引用注释。</li> <li>如果你只想要<code>SourceMap</code>映射错误报告中的错误堆栈跟踪信息，但不希望将<code>SourceMap</code>暴露给浏览器开发工具。</li></ul></li> <li><code>cheap-source-map</code> <ul><li>不带列映射(column-map)的<code>SourceMap</code>，忽略加载的<code>Source Map</code>。</li></ul></li> <li><code>cheap-module-source-map</code> <ul><li>不带列映射(column-map)的<code>SourceMap</code>，将加载的<code>Source Map</code>简化为每行单独映射。</li></ul></li> <li><code>nosources-source-map</code> <ul><li>创建一个没有<code>sourcesContent</code>的<code>SourceMap</code>。</li> <li>它可以用来映射客户端上的堆栈跟踪，而不会暴露所有的源码。</li></ul></li></ul></li></ul> <p>参考<a href="https://doc.webpack-china.org/configuration/devtool/" target="_blank" rel="noopener noreferrer">开发辅助调试工具(Devtool)<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>。</p> <h2 id="开发环境添加-source-map"><a href="#开发环境添加-source-map" class="header-anchor">#</a> 开发环境添加 source map</h2> <p>这里我们简单地添加<code>devtool</code>：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// build/dev-server.js</span>
webpackConfig<span class="token punctuation">.</span>devtool <span class="token operator">=</span> <span class="token string">&quot;eval-cheap-module-source-map&quot;</span><span class="token punctuation">;</span>
</code></pre></div><p>同时，在配置文件中，还有一个要点是<code>publicPath</code>不是<code>/</code>这样的值，而是<code>http://localhost:3000/</code>这样的绝对地址。这是因为，在使用?sourceMap 的时候，style-loader 会把 css 的引入做成这样：</p> <div class="language-html extra-class"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>stylesheet<span class="token punctuation">&quot;</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>blob:http://localhost:3000/asdasd<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
</code></pre></div><p>这种 blob 的形式可能会使得 css 里的 url()引用的图片失效，因此建议用带 http 的绝对地址（这也只有开发环境会用到）。</p> <p>所以我们有：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// webpack-dev-server中间件</span>
app<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>
  <span class="token function">WebpackDevMiddleware</span><span class="token punctuation">(</span>compiler<span class="token punctuation">,</span> <span class="token punctuation">{</span>
    publicPath<span class="token operator">:</span> <span class="token string">&quot;http://localhost:3000/&quot;</span><span class="token punctuation">,</span>
    stats<span class="token operator">:</span> <span class="token punctuation">{</span>
      colors<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
      chunks<span class="token operator">:</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    progress<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    inline<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    hot<span class="token operator">:</span> <span class="token boolean">true</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h2 id="生产环境-source-map"><a href="#生产环境-source-map" class="header-anchor">#</a> 生产环境 source map</h2> <p>同样的我们添加<code>devtool</code>：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// build/dev-server.js</span>
webpackConfig<span class="token punctuation">.</span>devtool <span class="token operator">=</span> <span class="token string">&quot;source-map&quot;</span><span class="token punctuation">;</span>
<span class="token comment">// 或者不需要source map</span>
webpackConfig<span class="token punctuation">.</span>devtool <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
</code></pre></div><p>生产环境很多时候我们会压缩代码，压缩的时候如果需要生成 source map 还需要配置：</p> <div class="language-js extra-class"><pre class="language-js"><code>plugins<span class="token operator">:</span> <span class="token punctuation">[</span>
  <span class="token keyword">new</span> <span class="token class-name">webpack<span class="token punctuation">.</span>optimize<span class="token punctuation">.</span>UglifyJsPlugin</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    sourceMap<span class="token operator">:</span> <span class="token boolean">true</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>
  <span class="token comment">// ...</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
</code></pre></div><p>参考了<a href="http://acgtofe.com/posts/2016/02/full-live-reload-for-express-with-webpack" target="_blank" rel="noopener noreferrer">《Express 结合 Webpack 的全栈自动刷新》<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>。</p> <h2 id="代码压缩"><a href="#代码压缩" class="header-anchor">#</a> 代码压缩</h2> <p>既然说到<code>UglifyJsPlugin</code>了，就顺便讲一下代码压缩吧。</p> <p>其实也没有多少东西，就是上面大家看到的<code>new webpack.optimize.UglifyJsPlugin()</code>，不过配置选项除了<code>sourceMap</code>还有注释<code>comments</code>相关、压缩<code>compress</code>相关。</p> <p>还有一个问题就是，<code>UglifyJs</code>不支持 ES6 的压缩，如果代码压缩前没有编译到 ES5，则打包任务会报错，通常显示：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token constant">ERROR</span> <span class="token keyword">in</span> xx<span class="token operator">/</span>xxxxx<span class="token punctuation">.</span>js from UglifyJs
Unexpected token xxxx
</code></pre></div><p>这时候我们需要将代码先通过<code>babel</code>生成<code>ES5</code>，然后再压缩：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token operator">:</span> <span class="token punctuation">{</span>
  rules<span class="token operator">:</span> <span class="token punctuation">[</span>
    <span class="token punctuation">{</span>
      test<span class="token operator">:</span> <span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">\.js$</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">,</span>
      loader<span class="token operator">:</span> <span class="token string">&quot;babel-loader&quot;</span><span class="token punctuation">,</span>
      exclude<span class="token operator">:</span> <span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">node_modules</span><span class="token regex-delimiter">/</span></span>
    <span class="token punctuation">}</span>
    <span class="token comment">// 其他loader排在后面</span>
  <span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>大致就酱啦。</p> <h1 id="结束语"><a href="#结束语" class="header-anchor">#</a> 结束语</h1> <p>本节我们大致了解了 source map 的功能和一些 devtool 的选项，包括生产环境和开发环境可能需要注意的地方，以及简单说了个代码压缩的坑。<br>
可参考代码<a href="https://github.com/godbasin/vue-multi-pages" target="_blank" rel="noopener noreferrer">github-vue-multi-pages<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>，主要是这套环境使用在 vue 上的 demo。</p></div> <!----> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/godbasin/front-end-playground/edit/sourcecode/docs/vue/vue-multi-page/7-source-map-and-uglifyjs.md" target="_blank" rel="noopener noreferrer">帮阿猪改善此页面！</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----> <blockquote>部分文章中使用了一些网站的截图，如果涉及侵权，请告诉我删一下谢谢~</blockquote> <div style="margin-top:30px;"><div class="el-row" style="margin-left:-10px;margin-right:-10px;"><div class="el-col el-col-24 el-col-sm-0 el-col-md-2 el-col-lg-4" style="padding-left:10px;padding-right:10px;display:block;"><div style="width:1px;height:1px;"></div></div> <div class="el-col el-col-24 el-col-sm-24 el-col-md-18 el-col-lg-16" style="padding-left:10px;padding-right:10px;"><div class="el-card box-card is-always-shadow"><div class="el-card__header"><div class="clearfix"><span>温馨提示喵</span></div></div><div class="el-card__body"> <div class="el-row" style="margin-left:-10px;margin-right:-10px;"><div class="el-col el-col-24 el-col-xs-24 el-col-sm-12" style="padding-left:10px;padding-right:10px;"><div class="el-image"><div class="image-slot"><img src="https://github-imglib-1255459943.cos.ap-chengdu.myqcloud.com/assets/img/loading.gif" style="width:100%;"></div><!----></div></div> <div class="el-col el-col-24 el-col-xs-24 el-col-sm-12" style="padding-left:10px;padding-right:10px;"><div class="copyright-text"><div>本文版权归作者所有，欢迎转载，但未经作者同意必须保留此段声明，且在文章页面明显位置给出原文连接，否则保留追究法律责任的权利。</div> <div>出处：被删的前端游乐场</div> <div>作者：<a href="https://github.com/godbasin" target="_blank">被删</a></div></div></div></div></div></div></div></div></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/front-end-playground/vue/vue-multi-page/6-hot-reload.html" class="prev">
          6. 热加载刷新
        </a></span> <span class="next"><a href="/front-end-playground/vue/vue-multi-page/8-certain-loaders.html">
          8. 静态资源 loader 们
        </a>
        →
      </span></p></div>  <div class="gitalk-container theme-default-content"><div id="gitalk-container" class="content"></div></div></main> <div id="kitty-container"><span><div role="tooltip" id="el-popover-9608" aria-hidden="true" class="el-popover el-popper" style="width:undefinedpx;display:none;"><!----><img src="https://github-imglib-1255459943.cos.ap-chengdu.myqcloud.com/2code2.jpg" class="image"> <div class="text">牡羊猪的猫粮罐</div> </div><span class="el-popover__reference-wrapper"><div id="kitty" style="background:url(https://github-imglib-1255459943.cos.ap-chengdu.myqcloud.com/assets/img/kitty2.svg);"></div></span></span> <div class="el-dialog__wrapper" style="display:none;"><div role="dialog" aria-modal="true" aria-label="牡羊猪是这样渐渐胖成猪的喵（点击图片可以切换噢）" class="el-dialog" style="margin-top:15vh;"><div class="el-dialog__header"><span class="el-dialog__title">牡羊猪是这样渐渐胖成猪的喵（点击图片可以切换噢）</span><button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button></div><!----><!----></div></div></div></div><div class="global-ui"></div></div>
    <script src="/front-end-playground/assets/js/app.1e2670bf.js" defer></script><script src="/front-end-playground/assets/js/2.38d016d1.js" defer></script><script src="/front-end-playground/assets/js/3.e3f029cb.js" defer></script><script src="/front-end-playground/assets/js/149.1a9bd99e.js" defer></script>
  </body>
</html>
